package symbol;

import java.util.ArrayList;

/**
 * Symbol class. Defines methods, for example F(radius*1.1, height*1.1). 
 * Does not store parameters (radius, height).
 * parameters are stored by symbol instances.
 * Formal language productions are defined using LSymbolClasses.
 * 
 * @author Marek Paterczyk <marek.paterczyk@gmail.com>
 *
 */
public class LSymbolClass
{
	/**
	 * Name used for comparsion of instances, for example F.
	 */
	private String symbol;
	/**
	 * Unique class name, for example F(radius*1.1)
	 */
	private String symbolClass;
	/**
	 * List of methods.
	 */	
	private ArrayList<LMethod> methods = new ArrayList<LMethod>();
			
	public LSymbolClass(String symbol, String symbolClass)
	{
		super();
		this.symbol = symbol;
		this.symbolClass = symbolClass;
	}

	public void addMethod(LMethod method){
		methods.add(method);
	}
	
	public ArrayList<LMethod> getMethods(){
		return methods;
	}
	
	@Override
	public boolean equals(Object obj)
	{
		return symbol.equals(obj.toString());
	}
	
	@Override
	public String toString(){
		return symbol;
	}

	public String getSymbol()
	{
		return symbol;
	}

	public String getSymbolClass()
	{
		return symbolClass;
	}

}
